﻿using System;
using System.Collections.Generic;
using System.Text;

namespace EFcore
{
   public class SeeView
    {
        //public class Initializer : DropCreateDatabaseAlways<DonatorContext>
        //{
        //    protected override void Seed(DonatorContext context)
        //    {
        //        string drop = @"DROP TABLE DonatorViews";

        //        context.Database.ExecuteSqlCommand(drop);

        //        var createView = @"CREATE VIEW [dbo].[DonatorViews] 
        //        AS SELECT 
        //          dbo.Donators.Id as DonatorId,
        //          dbo.Donators.Name as DonatorName,
        //          dbo.Donators.Amount as Amount,
        //          dbo.Donators.DonateDate as DonateDate,
        //          dbo.Provinces.ProvinceName as ProvinceName
        //        FROM dbo.Donators inner join dbo.Provinces on dbo.Donators.Province_Id = dbo.Provinces.Id ";

        //        context.Database.ExecuteSqlCommand(createView);

        //        base.Seed(context);
        //    }
        //}
    }
}
